﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/admin/AdminMaster.master"
    CodeBehind="OrgsGrid.aspx.cs" StylesheetTheme="Skin1" Inherits="MLY.Admin.WebForm1"
    Title='<%$Dict:OrgsGrid.Title%>' %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="server">
    <div>
        <asp:Label ID="lblErrMsg" runat="server" ForeColor="Red" Font-Bold="true" Visible="false"
            Text='<%$Dict:OrgsGrid.lblErrMsg%>'></asp:Label>
        <asp:Label ID="lblSuccessMsg" runat="server" ForeColor="Green" Font-Bold="true" Visible="false"
            Text='<%$Dict:OrgsGrid.lblSuccessMsg%>'></asp:Label>
    </div>
    <div id="divGrid" visible="false">
        <table class="customGrid" style="width: 100%;">
            <tr>
                <td>
                    <asp:Label ID="lblSortingCriteria" runat="server" Font-Bold="True" Text="<%$ Dict:OrgGrid.lblSortingCriteria: %>"></asp:Label>
                    <asp:Label ID="lblClassification" runat="server" Text="<%$ Dict:OrgGrid.lblClassification: %>"></asp:Label>
                    <asp:DropDownList ID="ddlOrgClassification" runat="server" DataSourceID="LinqDataSource2"
                        DataTextField="ClassificationDescription" DataValueField="ClassificationId" OnPreRender="ddlOrgClassification_PreRender">
                    </asp:DropDownList>
                    <br />
                    <asp:Label ID="lblOrgName" runat="server" Text="<%$Dict:OrgGrid.lblOrgName:%>"></asp:Label>
                    <asp:TextBox ID="txtOrgName" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="imgbtnSearch" runat="server" ImageUrl="~/Images/search.png"
                        OnClick="imgbtnSearch_OnClick" Style="height: 16px" /><br />
                    <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="MLY.Dal.lqKbmDataContext"
                        TableName="LookupClassifications">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" SkinID="GridViewSkin"
                        OnPreRender="GridView1_PreRender" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging"
                        PageSize='<%# Session["DefaultLinesinGrid"] != null ?  int.Parse(Session["DefaultLinesinGrid"].ToString()) : 20 %>'>
                        <Columns>
                            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader"  ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%# Eval("OrganizationId") %>'
                                        ImageUrl="~/Images/Cancel.gif" OnClick="btnDelete_OnClick" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="30" HeaderStyle-CssClass="dottedLineRightHeader">
                                <HeaderTemplate>
                                    <asp:HyperLink ID="HyperLinkAddNew" runat="server" NavigateUrl="<%#&quot;editOrg.aspx?Edit=-1&quot;%>">
                                        <asp:Image ID="imgAddNew" runat="server" ImageUrl="~/Images/imgbtnAdd.png" />
                                    </asp:HyperLink>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLinkOpen" runat="server" NavigateUrl="<%#String.Format(&quot;editOrg.aspx?Edit={0}&quot;,Eval(&quot;OrganizationId&quot;))%>">
                                        <asp:Image ID="imgOpen" runat="server" ImageUrl="~/Images/Magnifier.png" />
                                    </asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:BoundField DataField="OrganizationId" HeaderStyle-Width="20" HeaderStyle-CssClass="dottedLineRightHeader"
                                HeaderText='<%$Dict:OrgsGrid.OrganizationId%>' ReadOnly="True" SortExpression="OrganizationId" />
                            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" HeaderText='<%$Dict:OrgsGrid.IsClient%>'
                                SortExpression="IsClient">
                                <ItemTemplate>
                                    <uc:StyledCheckBox runat="server" readOnly="true" Checked='<%# Eval("IsClient") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" HeaderText='<%$Dict:OrgsGrid.IsContractor%>'
                                SortExpression="IsContractor">
                                <ItemTemplate>
                                    <uc:StyledCheckBox readOnly="true"  runat="server" Checked='<%# Eval("IsContractor") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="OrganizationName" HeaderText='<%$Dict:OrgsGrid.OrganizationName%>'
                                ReadOnly="True" HeaderStyle-CssClass="dottedLineRightHeader" SortExpression="OrganizationName" />
                            <asp:BoundField DataField="Address" HeaderText='<%$Dict:OrgsGrid.Address%>' HeaderStyle-CssClass="dottedLineRightHeader"
                                ReadOnly="True" SortExpression="Address" />
                            <asp:BoundField DataField="ContactPerson" HeaderStyle-CssClass="dottedLineRightHeader"
                                HeaderText='<%$Dict:OrgsGrid.ContactPerson%>' ReadOnly="True" SortExpression="ContactPerson" />
                            <asp:BoundField DataField="ContactPersonPhone" HeaderText='<%$Dict:OrgsGrid.ContactPersonPhone%>'
                                HeaderStyle-CssClass="dottedLineRightHeader" ReadOnly="True" SortExpression="ContactPersonPhone" />
                            <asp:BoundField DataField="ContactPersonEmail" HeaderText='<%$Dict:OrgsGrid.ContactPersonEmail%>'
                                ReadOnly="True" HeaderStyle-CssClass="dottedLineRightHeader" SortExpression="ContactPersonEmail" />
                            <asp:BoundField DataField="Tag" HeaderText='<%$Dict:OrgsGrid.Tag%>' ReadOnly="True"
                                SortExpression="Tag" HeaderStyle-CssClass="dottedLineRightHeader" />
                            <asp:BoundField DataField="WebSite" HeaderText='<%$Dict:OrgsGrid.WebSite%>' ReadOnly="True"
                                SortExpression="WebSite" HeaderStyle-CssClass="dottedLineRightHeader" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <div id="divEmptyGrid" visible="false" runat="server">
            <asp:Label ID="lblNoOrgFound" Text="<%$Dict:OrgGrid.lblNoOrgFoundMsg%>" runat="server"
                Visible="false"></asp:Label>
            <asp:ImageButton ID="imgAddNewOnNoRows" ImageUrl="~/Images/imgbtnAdd.png" runat="server"
                OnClick="imgAddNewOnNoRows_Click" />
        </div>
    </div>
</asp:Content>
